package com.qf.fmall2302.vo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ResultVo {
    private Integer code; //状态码，10000代表成功 10001代表失败
    private String msg; //code状态码的含义
    private Object data; //返回的数据


    public static ResultVo error(int code, String msg) {
        ResultVo resultVo = new ResultVo(code, msg, null);
        return resultVo;
    }

    public static ResultVo ok(int code, String msg, Object data) {
        return new ResultVo(code,msg,data);
    }
}
